#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int m, n, tmp;
	long long ans;
	while (cin >> m >> n)
	{
		ans = 0;
		if (m > n) { tmp = m; m = n; n = tmp; }
		for (int i = 0; i < m; i++)ans += (m - i) * (n - i);
		cout << ans % 1000000007 << endl;
	}
	return 0;
}